3.304 \(\int (g+h x) (A+B \log (e (a+b x)^n (c+d x)^{-n}))^2 \, dx\)

Optimal. Leaf size=294 \[ \frac{B^2 n^2 (b c-a d) (-a d h-b c h+2 b d g) \text{PolyLog}\left (2,\frac{d (a+b x)}{b (c+d x)}\right )}{b^2 d^2}+\frac{B n (b c-a d) (-a d h-b c h+2 b d g) \log \left (\frac{b c-a d}{b (c+d x)}\right ) \left (B \log \left (e (a+b x)^n (c+d x)^{-n}\right )+A\right )}{b^2 d^2}-\frac{(b g-a h)^2 \left (B \log \left (e (a+b x)^n (c+d x)^{-n}\right )+A\right )^2}{2 b^2 h}-\frac{B h n (a+b x) (b c-a d) \left (B \log \left (e (a+b x)^n (c+d x)^{-n}\right )+A\right )}{b^2 d}+\frac{(g+h x)^2 \left (B \log \left (e (a+b x)^n (c+d x)^{-n}\right )+A\right )^2}{2 h}+\frac{B^2 h n^2 (b c-a d)^2 \log (c+d x)}{b^2 d^2} \]

[Out]

(B^2*(b*c - a*d)^2*h*n^2*Log[c + d*x])/(b^2*d^2) - (B*(b*c - a*d)*h*n*(a + b*x)*(A + B*Log[(e*(a + b*x)^n)/(c
+ d*x)^n]))/(b^2*d) + (B*(b*c - a*d)*(2*b*d*g - b*c*h - a*d*h)*n*Log[(b*c - a*d)/(b*(c + d*x))]*(A + B*Log[(e*
(a + b*x)^n)/(c + d*x)^n]))/(b^2*d^2) - ((b*g - a*h)^2*(A + B*Log[(e*(a + b*x)^n)/(c + d*x)^n])^2)/(2*b^2*h) +
 ((g + h*x)^2*(A + B*Log[(e*(a + b*x)^n)/(c + d*x)^n])^2)/(2*h) + (B^2*(b*c - a*d)*(2*b*d*g - b*c*h - a*d*h)*n
^2*PolyLog[2, (d*(a + b*x))/(b*(c + d*x))])/(b^2*d^2)

________________________________________________________________________________________

Rubi [A]  time = 0.955147, antiderivative size = 449, normalized size of antiderivative = 1.53, number of steps used = 20, number of rules used = 11, integrand size = 31, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.355, Rules used = {6742, 2492, 72, 2514, 2486, 31, 2488, 2411, 2343, 2333, 2315} \[ -\frac{B^2 n^2 (b g-a h)^2 \text{PolyLog}\left (2,\frac{b c-a d}{d (a+b x)}+1\right )}{b^2 h}-\frac{B^2 n^2 (d g-c h)^2 \text{PolyLog}\left (2,\frac{d (a+b x)}{b (c+d x)}\right )}{d^2 h}-\frac{A B n (b g-a h)^2 \log (a+b x)}{b^2 h}+\frac{A B (g+h x)^2 \log \left (e (a+b x)^n (c+d x)^{-n}\right )}{h}-\frac{A B h n x (b c-a d)}{b d}+\frac{B^2 h n^2 (b c-a d)^2 \log (c+d x)}{b^2 d^2}+\frac{B^2 n (b g-a h)^2 \log \left (-\frac{b c-a d}{d (a+b x)}\right ) \log \left (e (a+b x)^n (c+d x)^{-n}\right )}{b^2 h}-\frac{B^2 h n (a+b x) (b c-a d) \log \left (e (a+b x)^n (c+d x)^{-n}\right )}{b^2 d}-\frac{B^2 n (d g-c h)^2 \log \left (\frac{b c-a d}{b (c+d x)}\right ) \log \left (e (a+b x)^n (c+d x)^{-n}\right )}{d^2 h}+\frac{B^2 (g+h x)^2 \log ^2\left (e (a+b x)^n (c+d x)^{-n}\right )}{2 h}+\frac{A^2 (g+h x)^2}{2 h}+\frac{A B n (d g-c h)^2 \log (c+d x)}{d^2 h} \]

Antiderivative was successfully verified.

[In]

Int[(g + h*x)*(A + B*Log[(e*(a + b*x)^n)/(c + d*x)^n])^2,x]

[Out]

-((A*B*(b*c - a*d)*h*n*x)/(b*d)) + (A^2*(g + h*x)^2)/(2*h) - (A*B*(b*g - a*h)^2*n*Log[a + b*x])/(b^2*h) + (A*B
*(d*g - c*h)^2*n*Log[c + d*x])/(d^2*h) + (B^2*(b*c - a*d)^2*h*n^2*Log[c + d*x])/(b^2*d^2) - (B^2*(b*c - a*d)*h
*n*(a + b*x)*Log[(e*(a + b*x)^n)/(c + d*x)^n])/(b^2*d) + (A*B*(g + h*x)^2*Log[(e*(a + b*x)^n)/(c + d*x)^n])/h
+ (B^2*(b*g - a*h)^2*n*Log[-((b*c - a*d)/(d*(a + b*x)))]*Log[(e*(a + b*x)^n)/(c + d*x)^n])/(b^2*h) - (B^2*(d*g
 - c*h)^2*n*Log[(b*c - a*d)/(b*(c + d*x))]*Log[(e*(a + b*x)^n)/(c + d*x)^n])/(d^2*h) + (B^2*(g + h*x)^2*Log[(e
*(a + b*x)^n)/(c + d*x)^n]^2)/(2*h) - (B^2*(d*g - c*h)^2*n^2*PolyLog[2, (d*(a + b*x))/(b*(c + d*x))])/(d^2*h)
- (B^2*(b*g - a*h)^2*n^2*PolyLog[2, 1 + (b*c - a*d)/(d*(a + b*x))])/(b^2*h)

Rule 6742

Int[u_, x_Symbol] :> With[{v = ExpandIntegrand[u, x]}, Int[v, x] /; SumQ[v]]

Rule 2492

Int[Log[(e_.)*((f_.)*((a_.) + (b_.)*(x_))^(p_.)*((c_.) + (d_.)*(x_))^(q_.))^(r_.)]^(s_.)*((g_.) + (h_.)*(x_))^
(m_.), x_Symbol] :> Simp[((g + h*x)^(m + 1)*Log[e*(f*(a + b*x)^p*(c + d*x)^q)^r]^s)/(h*(m + 1)), x] - Dist[(p*
r*s*(b*c - a*d))/(h*(m + 1)), Int[((g + h*x)^(m + 1)*Log[e*(f*(a + b*x)^p*(c + d*x)^q)^r]^(s - 1))/((a + b*x)*
(c + d*x)), x], x] /; FreeQ[{a, b, c, d, e, f, g, h, m, p, q, r, s}, x] && NeQ[b*c - a*d, 0] && EqQ[p + q, 0]
&& IGtQ[s, 0] && NeQ[m, -1]

Rule 72

Int[((e_.) + (f_.)*(x_))^(p_.)/(((a_.) + (b_.)*(x_))*((c_.) + (d_.)*(x_))), x_Symbol] :> Int[ExpandIntegrand[(
e + f*x)^p/((a + b*x)*(c + d*x)), x], x] /; FreeQ[{a, b, c, d, e, f}, x] && IntegerQ[p]

Rule 2514

Int[Log[(e_.)*((f_.)*((a_.) + (b_.)*(x_))^(p_.)*((c_.) + (d_.)*(x_))^(q_.))^(r_.)]^(s_.)*(RFx_), x_Symbol] :>
With[{u = ExpandIntegrand[Log[e*(f*(a + b*x)^p*(c + d*x)^q)^r]^s, RFx, x]}, Int[u, x] /; SumQ[u]] /; FreeQ[{a,
 b, c, d, e, f, p, q, r, s}, x] && RationalFunctionQ[RFx, x] && IGtQ[s, 0]

Rule 2486

Int[Log[(e_.)*((f_.)*((a_.) + (b_.)*(x_))^(p_.)*((c_.) + (d_.)*(x_))^(q_.))^(r_.)]^(s_.), x_Symbol] :> Simp[((
a + b*x)*Log[e*(f*(a + b*x)^p*(c + d*x)^q)^r]^s)/b, x] + Dist[(q*r*s*(b*c - a*d))/b, Int[Log[e*(f*(a + b*x)^p*
(c + d*x)^q)^r]^(s - 1)/(c + d*x), x], x] /; FreeQ[{a, b, c, d, e, f, p, q, r, s}, x] && NeQ[b*c - a*d, 0] &&
EqQ[p + q, 0] && IGtQ[s, 0]

Rule 31

Int[((a_) + (b_.)*(x_))^(-1), x_Symbol] :> Simp[Log[RemoveContent[a + b*x, x]]/b, x] /; FreeQ[{a, b}, x]

Rule 2488

Int[Log[(e_.)*((f_.)*((a_.) + (b_.)*(x_))^(p_.)*((c_.) + (d_.)*(x_))^(q_.))^(r_.)]^(s_.)/((g_.) + (h_.)*(x_)),
 x_Symbol] :> -Simp[(Log[-((b*c - a*d)/(d*(a + b*x)))]*Log[e*(f*(a + b*x)^p*(c + d*x)^q)^r]^s)/h, x] + Dist[(p
*r*s*(b*c - a*d))/h, Int[(Log[-((b*c - a*d)/(d*(a + b*x)))]*Log[e*(f*(a + b*x)^p*(c + d*x)^q)^r]^(s - 1))/((a
+ b*x)*(c + d*x)), x], x] /; FreeQ[{a, b, c, d, e, f, g, h, p, q, r, s}, x] && NeQ[b*c - a*d, 0] && EqQ[p + q,
 0] && EqQ[b*g - a*h, 0] && IGtQ[s, 0]

Rule 2411

Int[((a_.) + Log[(c_.)*((d_) + (e_.)*(x_))^(n_.)]*(b_.))^(p_.)*((f_.) + (g_.)*(x_))^(q_.)*((h_.) + (i_.)*(x_))
^(r_.), x_Symbol] :> Dist[1/e, Subst[Int[((g*x)/e)^q*((e*h - d*i)/e + (i*x)/e)^r*(a + b*Log[c*x^n])^p, x], x,
d + e*x], x] /; FreeQ[{a, b, c, d, e, f, g, h, i, n, p, q, r}, x] && EqQ[e*f - d*g, 0] && (IGtQ[p, 0] || IGtQ[
r, 0]) && IntegerQ[2*r]

Rule 2343

Int[((a_.) + Log[(c_.)*(x_)^(n_)]*(b_.))/((x_)*((d_) + (e_.)*(x_)^(r_.))), x_Symbol] :> Dist[1/n, Subst[Int[(a
 + b*Log[c*x])/(x*(d + e*x^(r/n))), x], x, x^n], x] /; FreeQ[{a, b, c, d, e, n, r}, x] && IntegerQ[r/n]

Rule 2333

Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))^(p_.)*((d_) + (e_.)/(x_))^(q_.)*(x_)^(m_.), x_Symbol] :> Int[(e + d*
x)^q*(a + b*Log[c*x^n])^p, x] /; FreeQ[{a, b, c, d, e, m, n, p}, x] && EqQ[m, q] && IntegerQ[q]

Rule 2315

Int[Log[(c_.)*(x_)]/((d_) + (e_.)*(x_)), x_Symbol] :> -Simp[PolyLog[2, 1 - c*x]/e, x] /; FreeQ[{c, d, e}, x] &
& EqQ[e + c*d, 0]

Rubi steps

\begin{align*} \int (g+h x) \left (A+B \log \left (e (a+b x)^n (c+d x)^{-n}\right )\right )^2 \, dx &=\int \left (A^2 (g+h x)+2 A B (g+h x) \log \left (e (a+b x)^n (c+d x)^{-n}\right )+B^2 (g+h x) \log ^2\left (e (a+b x)^n (c+d x)^{-n}\right )\right ) \, dx\\ &=\frac{A^2 (g+h x)^2}{2 h}+(2 A B) \int (g+h x) \log \left (e (a+b x)^n (c+d x)^{-n}\right ) \, dx+B^2 \int (g+h x) \log ^2\left (e (a+b x)^n (c+d x)^{-n}\right ) \, dx\\ &=\frac{A^2 (g+h x)^2}{2 h}+\frac{A B (g+h x)^2 \log \left (e (a+b x)^n (c+d x)^{-n}\right )}{h}+\frac{B^2 (g+h x)^2 \log ^2\left (e (a+b x)^n (c+d x)^{-n}\right )}{2 h}-\frac{(A B (b c-a d) n) \int \frac{(g+h x)^2}{(a+b x) (c+d x)} \, dx}{h}-\frac{\left (B^2 (b c-a d) n\right ) \int \frac{(g+h x)^2 \log \left (e (a+b x)^n (c+d x)^{-n}\right )}{(a+b x) (c+d x)} \, dx}{h}\\ &=\frac{A^2 (g+h x)^2}{2 h}+\frac{A B (g+h x)^2 \log \left (e (a+b x)^n (c+d x)^{-n}\right )}{h}+\frac{B^2 (g+h x)^2 \log ^2\left (e (a+b x)^n (c+d x)^{-n}\right )}{2 h}-\frac{(A B (b c-a d) n) \int \left (\frac{h^2}{b d}+\frac{(b g-a h)^2}{b (b c-a d) (a+b x)}+\frac{(d g-c h)^2}{d (-b c+a d) (c+d x)}\right ) \, dx}{h}-\frac{\left (B^2 (b c-a d) n\right ) \int \left (\frac{h^2 \log \left (e (a+b x)^n (c+d x)^{-n}\right )}{b d}+\frac{(b g-a h)^2 \log \left (e (a+b x)^n (c+d x)^{-n}\right )}{b (b c-a d) (a+b x)}+\frac{(d g-c h)^2 \log \left (e (a+b x)^n (c+d x)^{-n}\right )}{d (-b c+a d) (c+d x)}\right ) \, dx}{h}\\ &=-\frac{A B (b c-a d) h n x}{b d}+\frac{A^2 (g+h x)^2}{2 h}-\frac{A B (b g-a h)^2 n \log (a+b x)}{b^2 h}+\frac{A B (d g-c h)^2 n \log (c+d x)}{d^2 h}+\frac{A B (g+h x)^2 \log \left (e (a+b x)^n (c+d x)^{-n}\right )}{h}+\frac{B^2 (g+h x)^2 \log ^2\left (e (a+b x)^n (c+d x)^{-n}\right )}{2 h}-\frac{\left (B^2 (b c-a d) h n\right ) \int \log \left (e (a+b x)^n (c+d x)^{-n}\right ) \, dx}{b d}-\frac{\left (B^2 (b g-a h)^2 n\right ) \int \frac{\log \left (e (a+b x)^n (c+d x)^{-n}\right )}{a+b x} \, dx}{b h}+\frac{\left (B^2 (d g-c h)^2 n\right ) \int \frac{\log \left (e (a+b x)^n (c+d x)^{-n}\right )}{c+d x} \, dx}{d h}\\ &=-\frac{A B (b c-a d) h n x}{b d}+\frac{A^2 (g+h x)^2}{2 h}-\frac{A B (b g-a h)^2 n \log (a+b x)}{b^2 h}+\frac{A B (d g-c h)^2 n \log (c+d x)}{d^2 h}-\frac{B^2 (b c-a d) h n (a+b x) \log \left (e (a+b x)^n (c+d x)^{-n}\right )}{b^2 d}+\frac{A B (g+h x)^2 \log \left (e (a+b x)^n (c+d x)^{-n}\right )}{h}+\frac{B^2 (b g-a h)^2 n \log \left (-\frac{b c-a d}{d (a+b x)}\right ) \log \left (e (a+b x)^n (c+d x)^{-n}\right )}{b^2 h}-\frac{B^2 (d g-c h)^2 n \log \left (\frac{b c-a d}{b (c+d x)}\right ) \log \left (e (a+b x)^n (c+d x)^{-n}\right )}{d^2 h}+\frac{B^2 (g+h x)^2 \log ^2\left (e (a+b x)^n (c+d x)^{-n}\right )}{2 h}+\frac{\left (B^2 (b c-a d)^2 h n^2\right ) \int \frac{1}{c+d x} \, dx}{b^2 d}-\frac{\left (B^2 (b c-a d) (b g-a h)^2 n^2\right ) \int \frac{\log \left (-\frac{b c-a d}{d (a+b x)}\right )}{(a+b x) (c+d x)} \, dx}{b^2 h}+\frac{\left (B^2 (b c-a d) (d g-c h)^2 n^2\right ) \int \frac{\log \left (-\frac{-b c+a d}{b (c+d x)}\right )}{(a+b x) (c+d x)} \, dx}{d^2 h}\\ &=-\frac{A B (b c-a d) h n x}{b d}+\frac{A^2 (g+h x)^2}{2 h}-\frac{A B (b g-a h)^2 n \log (a+b x)}{b^2 h}+\frac{A B (d g-c h)^2 n \log (c+d x)}{d^2 h}+\frac{B^2 (b c-a d)^2 h n^2 \log (c+d x)}{b^2 d^2}-\frac{B^2 (b c-a d) h n (a+b x) \log \left (e (a+b x)^n (c+d x)^{-n}\right )}{b^2 d}+\frac{A B (g+h x)^2 \log \left (e (a+b x)^n (c+d x)^{-n}\right )}{h}+\frac{B^2 (b g-a h)^2 n \log \left (-\frac{b c-a d}{d (a+b x)}\right ) \log \left (e (a+b x)^n (c+d x)^{-n}\right )}{b^2 h}-\frac{B^2 (d g-c h)^2 n \log \left (\frac{b c-a d}{b (c+d x)}\right ) \log \left (e (a+b x)^n (c+d x)^{-n}\right )}{d^2 h}+\frac{B^2 (g+h x)^2 \log ^2\left (e (a+b x)^n (c+d x)^{-n}\right )}{2 h}-\frac{\left (B^2 (b c-a d) (b g-a h)^2 n^2\right ) \operatorname{Subst}\left (\int \frac{\log \left (-\frac{b c-a d}{d x}\right )}{x \left (\frac{b c-a d}{b}+\frac{d x}{b}\right )} \, dx,x,a+b x\right )}{b^3 h}+\frac{\left (B^2 (b c-a d) (d g-c h)^2 n^2\right ) \operatorname{Subst}\left (\int \frac{\log \left (-\frac{-b c+a d}{b x}\right )}{x \left (\frac{-b c+a d}{d}+\frac{b x}{d}\right )} \, dx,x,c+d x\right )}{d^3 h}\\ &=-\frac{A B (b c-a d) h n x}{b d}+\frac{A^2 (g+h x)^2}{2 h}-\frac{A B (b g-a h)^2 n \log (a+b x)}{b^2 h}+\frac{A B (d g-c h)^2 n \log (c+d x)}{d^2 h}+\frac{B^2 (b c-a d)^2 h n^2 \log (c+d x)}{b^2 d^2}-\frac{B^2 (b c-a d) h n (a+b x) \log \left (e (a+b x)^n (c+d x)^{-n}\right )}{b^2 d}+\frac{A B (g+h x)^2 \log \left (e (a+b x)^n (c+d x)^{-n}\right )}{h}+\frac{B^2 (b g-a h)^2 n \log \left (-\frac{b c-a d}{d (a+b x)}\right ) \log \left (e (a+b x)^n (c+d x)^{-n}\right )}{b^2 h}-\frac{B^2 (d g-c h)^2 n \log \left (\frac{b c-a d}{b (c+d x)}\right ) \log \left (e (a+b x)^n (c+d x)^{-n}\right )}{d^2 h}+\frac{B^2 (g+h x)^2 \log ^2\left (e (a+b x)^n (c+d x)^{-n}\right )}{2 h}+\frac{\left (B^2 (b c-a d) (b g-a h)^2 n^2\right ) \operatorname{Subst}\left (\int \frac{\log \left (-\frac{(b c-a d) x}{d}\right )}{\left (\frac{b c-a d}{b}+\frac{d}{b x}\right ) x} \, dx,x,\frac{1}{a+b x}\right )}{b^3 h}-\frac{\left (B^2 (b c-a d) (d g-c h)^2 n^2\right ) \operatorname{Subst}\left (\int \frac{\log \left (-\frac{(-b c+a d) x}{b}\right )}{\left (\frac{-b c+a d}{d}+\frac{b}{d x}\right ) x} \, dx,x,\frac{1}{c+d x}\right )}{d^3 h}\\ &=-\frac{A B (b c-a d) h n x}{b d}+\frac{A^2 (g+h x)^2}{2 h}-\frac{A B (b g-a h)^2 n \log (a+b x)}{b^2 h}+\frac{A B (d g-c h)^2 n \log (c+d x)}{d^2 h}+\frac{B^2 (b c-a d)^2 h n^2 \log (c+d x)}{b^2 d^2}-\frac{B^2 (b c-a d) h n (a+b x) \log \left (e (a+b x)^n (c+d x)^{-n}\right )}{b^2 d}+\frac{A B (g+h x)^2 \log \left (e (a+b x)^n (c+d x)^{-n}\right )}{h}+\frac{B^2 (b g-a h)^2 n \log \left (-\frac{b c-a d}{d (a+b x)}\right ) \log \left (e (a+b x)^n (c+d x)^{-n}\right )}{b^2 h}-\frac{B^2 (d g-c h)^2 n \log \left (\frac{b c-a d}{b (c+d x)}\right ) \log \left (e (a+b x)^n (c+d x)^{-n}\right )}{d^2 h}+\frac{B^2 (g+h x)^2 \log ^2\left (e (a+b x)^n (c+d x)^{-n}\right )}{2 h}+\frac{\left (B^2 (b c-a d) (b g-a h)^2 n^2\right ) \operatorname{Subst}\left (\int \frac{\log \left (-\frac{(b c-a d) x}{d}\right )}{\frac{d}{b}+\frac{(b c-a d) x}{b}} \, dx,x,\frac{1}{a+b x}\right )}{b^3 h}-\frac{\left (B^2 (b c-a d) (d g-c h)^2 n^2\right ) \operatorname{Subst}\left (\int \frac{\log \left (-\frac{(-b c+a d) x}{b}\right )}{\frac{b}{d}+\frac{(-b c+a d) x}{d}} \, dx,x,\frac{1}{c+d x}\right )}{d^3 h}\\ &=-\frac{A B (b c-a d) h n x}{b d}+\frac{A^2 (g+h x)^2}{2 h}-\frac{A B (b g-a h)^2 n \log (a+b x)}{b^2 h}+\frac{A B (d g-c h)^2 n \log (c+d x)}{d^2 h}+\frac{B^2 (b c-a d)^2 h n^2 \log (c+d x)}{b^2 d^2}-\frac{B^2 (b c-a d) h n (a+b x) \log \left (e (a+b x)^n (c+d x)^{-n}\right )}{b^2 d}+\frac{A B (g+h x)^2 \log \left (e (a+b x)^n (c+d x)^{-n}\right )}{h}+\frac{B^2 (b g-a h)^2 n \log \left (-\frac{b c-a d}{d (a+b x)}\right ) \log \left (e (a+b x)^n (c+d x)^{-n}\right )}{b^2 h}-\frac{B^2 (d g-c h)^2 n \log \left (\frac{b c-a d}{b (c+d x)}\right ) \log \left (e (a+b x)^n (c+d x)^{-n}\right )}{d^2 h}+\frac{B^2 (g+h x)^2 \log ^2\left (e (a+b x)^n (c+d x)^{-n}\right )}{2 h}-\frac{B^2 (d g-c h)^2 n^2 \text{Li}_2\left (\frac{d (a+b x)}{b (c+d x)}\right )}{d^2 h}-\frac{B^2 (b g-a h)^2 n^2 \text{Li}_2\left (\frac{b (c+d x)}{d (a+b x)}\right )}{b^2 h}\\ \end{align*}

Mathematica [A]  time = 0.985289, size = 472, normalized size = 1.61 \[ \frac{2 B^2 n^2 (b c-a d) (a d h+b c h-2 b d g) \text{PolyLog}\left (2,\frac{d (a+b x)}{a d-b c}\right )-2 B n \log (a+b x) \left (a d \left (A (a d h-2 b d g)+B d (a h-2 b g) \log \left (e (a+b x)^n (c+d x)^{-n}\right )+B n (-a d h+b c h-2 b d g)\right )-B n (b c-a d) (a d h+b c h-2 b d g) \log \left (\frac{b (c+d x)}{b c-a d}\right )+b^2 B c n (c h-2 d g) \log (c+d x)\right )+b \left (d \left (2 B \log \left (e (a+b x)^n (c+d x)^{-n}\right ) (a B d n (h x-2 g)+b x (2 A d g+A d h x-B c h n))+2 a B n (-2 A d g+A d h x+B c h n-2 B d g n)+b B^2 d x (2 g+h x) \log ^2\left (e (a+b x)^n (c+d x)^{-n}\right )+A b x (2 A d g+A d h x-2 B c h n)\right )+2 B n \log (c+d x) \left (B n \left (b c^2 h-a d (c h+2 d g)\right )+b B c (c h-2 d g) \log \left (e (a+b x)^n (c+d x)^{-n}\right )+A b c (c h-2 d g)\right )+b B^2 c n^2 (c h-2 d g) \log ^2(c+d x)\right )+a B^2 d^2 n^2 (a h-2 b g) \log ^2(a+b x)}{2 b^2 d^2} \]

Antiderivative was successfully verified.

[In]

Integrate[(g + h*x)*(A + B*Log[(e*(a + b*x)^n)/(c + d*x)^n])^2,x]

[Out]

(a*B^2*d^2*(-2*b*g + a*h)*n^2*Log[a + b*x]^2 - 2*B*n*Log[a + b*x]*(b^2*B*c*(-2*d*g + c*h)*n*Log[c + d*x] - B*(
b*c - a*d)*(-2*b*d*g + b*c*h + a*d*h)*n*Log[(b*(c + d*x))/(b*c - a*d)] + a*d*(A*(-2*b*d*g + a*d*h) + B*(-2*b*d
*g + b*c*h - a*d*h)*n + B*d*(-2*b*g + a*h)*Log[(e*(a + b*x)^n)/(c + d*x)^n])) + b*(b*B^2*c*(-2*d*g + c*h)*n^2*
Log[c + d*x]^2 + 2*B*n*Log[c + d*x]*(A*b*c*(-2*d*g + c*h) + B*(b*c^2*h - a*d*(2*d*g + c*h))*n + b*B*c*(-2*d*g
+ c*h)*Log[(e*(a + b*x)^n)/(c + d*x)^n]) + d*(A*b*x*(2*A*d*g - 2*B*c*h*n + A*d*h*x) + 2*a*B*n*(-2*A*d*g - 2*B*
d*g*n + B*c*h*n + A*d*h*x) + 2*B*(a*B*d*n*(-2*g + h*x) + b*x*(2*A*d*g - B*c*h*n + A*d*h*x))*Log[(e*(a + b*x)^n
)/(c + d*x)^n] + b*B^2*d*x*(2*g + h*x)*Log[(e*(a + b*x)^n)/(c + d*x)^n]^2)) + 2*B^2*(b*c - a*d)*(-2*b*d*g + b*
c*h + a*d*h)*n^2*PolyLog[2, (d*(a + b*x))/(-(b*c) + a*d)])/(2*b^2*d^2)

________________________________________________________________________________________

Maple [C]  time = 2.088, size = 11007, normalized size = 37.4 \begin{align*} \text{output too large to display} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((h*x+g)*(A+B*ln(e*(b*x+a)^n/((d*x+c)^n)))^2,x)

[Out]

result too large to display

________________________________________________________________________________________

Maxima [B]  time = 3.61767, size = 1219, normalized size = 4.15 \begin{align*} \text{result too large to display} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((h*x+g)*(A+B*log(e*(b*x+a)^n/((d*x+c)^n)))^2,x, algorithm="maxima")

[Out]

A*B*h*x^2*log((b*x + a)^n*e/(d*x + c)^n) + 1/2*A^2*h*x^2 + 2*A*B*g*x*log((b*x + a)^n*e/(d*x + c)^n) + A^2*g*x
+ 2*(a*e*n*log(b*x + a)/b - c*e*n*log(d*x + c)/d)*A*B*g/e - (a^2*e*n*log(b*x + a)/b^2 - c^2*e*n*log(d*x + c)/d
^2 + (b*c*e*n - a*d*e*n)*x/(b*d))*A*B*h/e - (a*c*d*h*n^2 + (2*c*d*g*n*log(e) - (h*n^2 + h*n*log(e))*c^2)*b)*B^
2*log(d*x + c)/(b*d^2) + (2*a*b*d^2*g*n^2 - a^2*d^2*h*n^2 - (2*c*d*g*n^2 - c^2*h*n^2)*b^2)*(log(b*x + a)*log((
b*d*x + a*d)/(b*c - a*d) + 1) + dilog(-(b*d*x + a*d)/(b*c - a*d)))*B^2/(b^2*d^2) + 1/2*(B^2*b^2*d^2*h*x^2*log(
e)^2 + 2*(2*c*d*g*n^2 - c^2*h*n^2)*B^2*b^2*log(b*x + a)*log(d*x + c) - (2*c*d*g*n^2 - c^2*h*n^2)*B^2*b^2*log(d
*x + c)^2 - (2*a*b*d^2*g*n^2 - a^2*d^2*h*n^2)*B^2*log(b*x + a)^2 + 2*(a*b*d^2*h*n*log(e) - (c*d*h*n*log(e) - d
^2*g*log(e)^2)*b^2)*B^2*x + 2*((h*n^2 - h*n*log(e))*a^2*d^2 - (c*d*h*n^2 - 2*d^2*g*n*log(e))*a*b)*B^2*log(b*x
+ a) + (B^2*b^2*d^2*h*x^2 + 2*B^2*b^2*d^2*g*x)*log((b*x + a)^n)^2 + (B^2*b^2*d^2*h*x^2 + 2*B^2*b^2*d^2*g*x)*lo
g((d*x + c)^n)^2 + 2*(B^2*b^2*d^2*h*x^2*log(e) - (2*c*d*g*n - c^2*h*n)*B^2*b^2*log(d*x + c) + (a*b*d^2*h*n - (
c*d*h*n - 2*d^2*g*log(e))*b^2)*B^2*x + (2*a*b*d^2*g*n - a^2*d^2*h*n)*B^2*log(b*x + a))*log((b*x + a)^n) - 2*(B
^2*b^2*d^2*h*x^2*log(e) - (2*c*d*g*n - c^2*h*n)*B^2*b^2*log(d*x + c) + (a*b*d^2*h*n - (c*d*h*n - 2*d^2*g*log(e
))*b^2)*B^2*x + (2*a*b*d^2*g*n - a^2*d^2*h*n)*B^2*log(b*x + a) + (B^2*b^2*d^2*h*x^2 + 2*B^2*b^2*d^2*g*x)*log((
b*x + a)^n))*log((d*x + c)^n))/(b^2*d^2)

________________________________________________________________________________________

Fricas [F]  time = 0., size = 0, normalized size = 0. \begin{align*}{\rm integral}\left (A^{2} h x + A^{2} g +{\left (B^{2} h x + B^{2} g\right )} \log \left (\frac{{\left (b x + a\right )}^{n} e}{{\left (d x + c\right )}^{n}}\right )^{2} + 2 \,{\left (A B h x + A B g\right )} \log \left (\frac{{\left (b x + a\right )}^{n} e}{{\left (d x + c\right )}^{n}}\right ), x\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((h*x+g)*(A+B*log(e*(b*x+a)^n/((d*x+c)^n)))^2,x, algorithm="fricas")

[Out]

integral(A^2*h*x + A^2*g + (B^2*h*x + B^2*g)*log((b*x + a)^n*e/(d*x + c)^n)^2 + 2*(A*B*h*x + A*B*g)*log((b*x +
 a)^n*e/(d*x + c)^n), x)

________________________________________________________________________________________

Sympy [F(-1)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((h*x+g)*(A+B*ln(e*(b*x+a)**n/((d*x+c)**n)))**2,x)

[Out]

Timed out

________________________________________________________________________________________

Giac [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int{\left (h x + g\right )}{\left (B \log \left (\frac{{\left (b x + a\right )}^{n} e}{{\left (d x + c\right )}^{n}}\right ) + A\right )}^{2}\,{d x} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((h*x+g)*(A+B*log(e*(b*x+a)^n/((d*x+c)^n)))^2,x, algorithm="giac")

[Out]

integrate((h*x + g)*(B*log((b*x + a)^n*e/(d*x + c)^n) + A)^2, x)